using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class UIManager : MonoBehaviour
{
    static UIManager instance;

    public TextMeshProUGUI timeText, deathText;
    void Awake()
    {
        if (instance != null)
        {
            Destroy(gameObject);
            return;
        }

        instance = this;

        DontDestroyOnLoad(this);
    }

    public static void UpdateDeath(int deathCount)
    {
        instance.deathText.text = deathCount.ToString();
    }
    public static void UpdateTime(float time)
    {
        int minutes = (int)(time / 60);
        float seconds = time % 60;//119/60 1гр59
        instance.timeText.text = minutes.ToString("00") + ":" + seconds.ToString("00");
    }
}
